
#pragma once

#include "Control\Control.h"
#include "AlphaRes.h"


class GUI_API CBaseICtrl
:public CControl
{
public:
	CBaseICtrl(void);
	CBaseICtrl(UINT nID );
	CBaseICtrl(wstring strCaption,UINT nID );
	CBaseICtrl(DWORD dwStyle,wstring strCaption, const CRect &rc, UINT nID  );
	CBaseICtrl(DWORD dwStyle, wstring strCaption, int x, int y, int cx, int cy, UINT nID  );

	virtual ~CBaseICtrl(void);

	virtual void	Click(DWORD dwClick, POINT pt);
	virtual void	Paint(CDC* pDC);
	virtual void	ImprovePaint( HANDLE hDB ,HDC hdc =NULL );

	// conctrol only have one image
	virtual BOOL	LoadRes( wstring strRes,CMyUnCompress* pPack=NULL );
	//if contrl only have one img,this function just like LoadRes,here the same
	virtual BOOL	LoadStateRes( wstring strRes,int nState,CMyUnCompress* pPack=NULL );

	CSize	GetConBKSize();


	inline void SetShowLevel(USHORT nLevel ){
		m_nLev = nLevel;
	}

	inline int GetShowLevel(){
		return m_nLev;
	}


protected:
	void Init();

protected:
	CFAlphaRes*		m_pAlpRes;
	USHORT			m_nLev;

};
